package com.baor.controller;

import com.baor.domain.CouponVo;
import com.baor.service.CouponService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
@RestController
@RequestMapping("/coupon")
public class CouponController {
    @Autowired
    private CouponService couponService;
    @RequestMapping("/list")
    public AjaxResult<?> list(@RequestBody  Map<String,Object> params){
        return this.couponService.list(params);
    }
    @RequestMapping("/insert")
    public AjaxResult<?> insert(@RequestBody CouponVo couponVo){
        return this.couponService.insert(couponVo);
    }
    @RequestMapping("/delete")
    public AjaxResult<?> delete(@RequestBody Map<String,Object> params){
        return this.couponService.delete(params);
    }
    @RequestMapping("/update")
    public AjaxResult<?> update(@RequestBody CouponVo couponVo){
        return this.couponService.update(couponVo);
    }
    @RequestMapping("/separateList")
    public AjaxResult<?> separateList(){
        return this.couponService.separateList();
    }
    @RequestMapping("/goodsList")
    public AjaxResult<?> goodsList(){
        return this.couponService.goodsList();
    }
}
